package com.wnxy.common.base.enums.impl;

import com.wnxy.common.base.enums.IBaseCode;
import lombok.Getter;

/**
 * 响应状态码的枚举类，定义所有的返回状态码(描述名称与值)
 */
@Getter
public enum ResultCode implements IBaseCode {
    // 声明枚举对象
    SUCCESS(200,"操作成功"),
    FAIL(500,"服务器内部错误！"),

    /* 数据错误：50001-599999 */
    RESULT_DATA_NONE(50001, "数据未找到"),
    DATA_IS_WRONG(50002, "数据有误"),
    DATA_ALREADY_EXISTED(50003, "数据已存在"),

    /* 参数错误：30001-39999 */
    PARAM_IS_INVALID(30001, "参数无效"),
    PARAM_IS_BLANK(30002, "参数为空"),
    PARAM_TYPE_BIND_ERROR(30003, "参数类型错误");

    private Integer code;
    private String message;

    ResultCode(Integer code,String message){
        this.code = code;
        this.message = message;
    }
}
